package main;

import java.util.ArrayList;
import java.util.Date;
import java.lang.UnsupportedOperationException;

public class Post implements Explorable {
	private String author;
	private String title;
	private String message;
	private Date submissionDate;
	private ArrayList<Post> answers;
	private int depth;

	public Post(String a, String t, String m, int d) {
		author = a;
		title = t;
		message = m;
		depth = d;
		answers = new ArrayList<>();
	}
	public void accept(ExplorerEntity ee) {
		ee.explore(this);
		for (Post p: answers)
			p.accept(ee);
	}
	public void reply(Post p) {
		answers.add(p);
	}

	public String getAuthor() {return author;}
	public String getTitle() {return title;}
	public Date getDate() {return submissionDate;}
	public String getMessage() {return message;}
	public void setMessage(String m) {message = m;}
	public int getDepth() {return depth;}
}
